<?php
/**
 *The rail_root object in unique in each rail tree. It's the root of the tree.
 *
 * PHP versions 5
 *
 * Copyright (C)
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of ERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
 * Fundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 *
 * @author Bastian Schröder <bs@chemanet.de>
 * @version 2007-07-19
 * @package rail
 */
class rail_root extends rail_container {

	/**
	 * Attributes which are not writeable from outside. Outside means by calling set_attribute(s) method.
	 * The array contains only the name of protected attributes not the attribute itself.
	 *
	 * @var array
	 */
	protected $protected_attributes = array( OBJ_TIME_CREATE, OBJ_TIME_LASTWRITE, RAIL_VERSION );


	/**
	 * Throw an Exception if called, because rail_root has no environment it is the root of the rail tree.
	 *
	 * @exception rail_exception
	 */
	public function get_environment () {
		throw new rail_exception( $this, 'The root container has no environment!' );
	}


	/**
	 * The rail_root has the '/' Symbol as path.
	 *
	 * @return string
	 */
	public function get_path () {
		return $this->cache[ 'path' ] = '/';
	}


	/**
	 * You can't move the rail_root because its the root of the rail tree.
	 *
	 * @exception rail_exception
	 */
	public function move ( $pRailObject ) {
		throw new rail_exception( $this, 'The root container can\'t move!' );
	}

} // End of rail_root
?>